import request from '../utils/request'
let { ALL } = window.Glob

// 登录
export function loginApi (data) {
  return request({
    url: '/apis/api/Login',
    method: 'post',
    data
  })
}

// 获取钉钉token
export function getAccessToken (params) {
  return request({
    url: '/dingtalk/v1.0/oauth2/accessToken',
    method: 'POST',
    data: params
  })
}

// 获取钉钉userID
export function getUser (query, body) {
  return request({
    url: '/oapi/topapi/v2/user/getuserinfo',
    method: 'POST',
    params: query,
    data: body
  })
}

// 获取钉钉用户详情
export function getUserInfo (query, body) {
  return request({
    url: '/oapi/topapi/v2/user/get',
    method: 'POST',
    params: query,
    data: body
  })
}

// 获取项目信息
export function getProjectListApi () {
  return request({
    url: '/apis/api/DicGet',
    method: 'post'
  })
}

// 新增项目
export function addProApi (data) {
  return request({
    url: '/apis/api/ProjectAdd',
    method: 'post',
    params: data
  })
}

// 点击项目阶段获取当前阶段的项目数据
export function getStageProjectListApi (data) {
  return request({
    url: '/apis/api/ProjectGet',
    method: 'post',
    params: data
  })
}

// 获取项目详情
export function getProjectInfoApi (data) {
  return request({
    url: '/apis/api/ProInfo',
    method: 'post',
    params: data
  })
}

// 获取项目合同信息
export function getProjectContractApi (data) {
  return request({
    url: '/apis/api/ContractGet',
    method: 'post',
    params: data
  })
}

// 获取项目在岗成员数据
export function getProjectDutyApi (data) {
  return request({
    url: '/apis/api/ProDuty',
    method: 'post',
    params: data
  })
}

// 获取项目团队成员数据
export function getProjectTeamApi (data) {
  return request({
    url: '/apis/api/ProLeader',
    method: 'post',
    params: data
  })
}

// 获取项目里程碑数据
export function getProjectMilestonesApi (data) {
  return request({
    url: '/apis/api/MilestonesGet',
    method: 'post',
    params: data
  })
}

// 获取员工列表
export function getEmpolyeeListApi () {
  return request({
    url: '/apis/api/EmployeeInfoGet',
    method: 'post'
  })
}

// 获取员工信息
export function EmployeeInfoGetApi (date) {
  return request({
    url: '/apis/api/EmployeeInfoGet',
    method: 'post',
    params: date
  })
}

// 更新项目信息
export function updateProApi (data) {
  return request({
    url: '/apis/api/ProjectUpdate',
    method: 'post',
    params: data
  })
}

// 获取文件列表
export function getProFileListApi (data) {
  return request({
    url: '/apis/api/FileGet',
    method: 'post',
    params: data
  })
}

// 删除文件
export function delProFileApi (data) {
  return request({
    url: '/apis/api/FileDelete',
    method: 'post',
    params: data
  })
}

// 更新里程碑数据
export function updateMilestoneApi (data, query) {
  return request({
    url: '/apis/api/MilestonesPut',
    method: 'post',
    params: query,
    data
  })
}

// 日报提交
export function subDailyPaperApi (data) {
  return request({
    url: '/apis/api/DailyPaperAdd',
    method: 'post',
    params: data
  })
}

// 获取日报列表
export function getDailyInfoListApi (data) {
  return request({
    url: '/apis/api/DailyPaperGet',
    method: 'post',
    params: data
  })
}

// 获取费用信息
export function getAmountDataApi (data) {
  return request({
    url: '/apis/api/FeeGet',
    method: 'post',
    params: data
  })
}

// 新增费用信息
export function addAmountDataApi (data) {
  return request({
    url: '/apis/api/FeeAdd',
    method: 'post',
    params: data
  })
}

// 删除费用信息
export function delAmountDataApi (data) {
  return request({
    url: '/apis/api/FeeDelete',
    method: 'post',
    params: data
  })
}

// 修改费用信息
export function updateAmountDataApi (data) {
  return request({
    url: '/apis/api/FeeUpdate',
    method: 'post',
    params: data
  })
}

// 获取记录列表
export function getAnnexListDataApi (params, data) {
  return request({
    url: '/apis/api/DetailGet',
    method: 'post',
    params: params,
    data: data
  })
}

// 新增记录
export function addDetailDataApi (data) {
  return request({
    url: '/apis/api/DetailAdd',
    method: 'post',
    params: data
  })
}

// 删除记录
export function deleteDetailDataApi (data) {
  return request({
    url: '/apis/api/DetailDelete',
    method: 'post',
    params: data
  })
}

// 编辑记录
export function updateDetailDataApi (data) {
  return request({
    url: '/apis/api/DetailUpdate',
    method: 'post',
    params: data
  })
}

// 下载附件
export function downloadFileApi (data) {
  return request({
    url: '/apis/api/FilesDownload',
    method: 'get',
    params: data
  })
}

// 获取附件列表
export function getFilesListApi (data) {
  return request({
    url: '/apis/api/FilesGet',
    method: 'post',
    params: data
  })
}

// 编辑记录
export function delFilesApi (data) {
  return request({
    url: '/apis/api/FilesDelete',
    method: 'post',
    params: data
  })
}

// 获取字典
export function getDictionaryListApi (data) {
  return request({
    url: '/apis/api/DicGet',
    method: 'post',
    params: data
  })
}

// 新增字典
export function addDictionaryApi (data) {
  return request({
    url: '/apis/api/DicAdd',
    method: 'post',
    params: data
  })
}

// 修改字典
export function updateDictionaryApi (data) {
  return request({
    url: '/apis/api/DicUpdate',
    method: 'post',
    params: data
  })
}

// 删除字典
export function deleteDictionaryApi (data) {
  return request({
    url: '/apis/api/DicDelete',
    method: 'post',
    params: data
  })
}
// 添加标签
export function addTagApi (data) {
  return request({
    url: '/apis/api/AddTag',
    method: 'post',
    params: data
  })
}

// 获取标签
export function getTagApi (data) {
  return request({
    url: '/apis/api/GetTag',
    method: 'post',
    params: data
  })
}